package com.sp.biz.user.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sp.biz.user.bo.UserInfoBO;
import com.sp.biz.user.query.UserInfoParam;
import com.sp.biz.user.service.UserInfoService;
import com.sp.biz.user.vo.UserInfoVO;
import com.sp.common.vo.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
@Tag(name = "用户管理")
public class UserInfoController {

    @Autowired
    UserInfoService userInfoService;

    @PostMapping("/list")
    @Operation(summary = "userInfo",description = "获取用户列表")
    public Result<Page<UserInfoVO>> getUserInfo(@RequestBody UserInfoParam userInfoParam){
        Page<UserInfoVO> page = userInfoService.list(userInfoParam);
        return Result.succeed(page);
    }

    @PostMapping("/add")
    public Result addUserInfo(@RequestBody UserInfoBO userInfoBO){

        return Result.succeed("新增成功");
    }

    @PostMapping("/update")
    public Result updateUserInfo(@RequestBody UserInfoBO userInfoBO){

        return Result.succeed("修改成功");
    }
}
